﻿using System;
using System.Collections.Generic;

namespace ToDict
{
    public partial class StringExt
    {
        internal IEnumerable<Messages.ParamValue> SplitIntoParamValues(IEnumerable<Messages.Setting> settings  )
        {
            var paramValues = new List<Messages.ParamValue>();
            foreach (var setting in settings) {
                var paramValue = setting.Value.Split(new[] { '=' }, StringSplitOptions.RemoveEmptyEntries);
                paramValues.Add(new Messages.ParamValue { Value = new Tuple<string, string>(paramValue[0], paramValue[1]) });
            }
            return paramValues;
        }

    }
}